<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.sql.DriverManager" %><%--
  Created by IntelliJ IDEA.
  User: Hasee
  Date: 2018/11/16
  Time: 11:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>测试</title>
</head>
<body>
<%
    String url="jdbc:mysql://localhost:3306/traveller";
    String user="root";
    String password="wsl2350663248";
    Class.forName("com.mysql.jdbc.Driver");
    Connection con= DriverManager.getConnection(url,user,password);
    Statement atmt=con.createStatement();
    ResultSet rs=atmt.executeQuery("SELECT * FROM users");
    while (rs.next()){%>
学号：<%=rs.getString("number")%>
姓名：<%=rs.getString("name")%>
成绩：<%=rs.getString("grade")%>

<% }%>
</body>
</html>
